using System;
using System.Collections.Generic;
using Is.Core;

namespace Is
{
    public static class IsDateTimeFluentExtensions
    {
        public static bool Equal(this IIs<DateTime> iser, DateTime expected, TimeSpan tolerance)
        {
            return iser.Apply(
                t => Core.Is.Equal(t, expected, tolerance),
                t => Core.Is.NotEqual(t, expected, tolerance)
            );
        }

        public static bool Equal(this IIs<DateTime> iser, DateTime expected, DatePrecision precision)
        {
            return iser.Apply(
                t => Core.Is.Equal(t, expected, precision),
                t => Core.Is.NotEqual(t, expected, precision)
            );
        }

        public static bool Today(this IIs<DateTime> iser)
        {
            return iser.Apply(
                t => Core.Is.Equal(t.Date, DateTime.Today),
                t => Core.Is.NotEqual(t.Date, DateTime.Today));
        }
    }
}